<?php

	/*
		读取最新的数据
	*/
	
	require_once('includes/config.inc.php');
	
	//输出内容

	$output = array();
	
	$result_data = array();
	
	$sql = mysql_query("SELECT `ID` , `post_title` , `post_content` , `post_date` FROM `wp_posts` WHERE `post_status` = 'publish' ORDER BY `post_date` DESC LIMIT 10 ");
	while($data = mysql_fetch_array($sql)){
		$result_data[] = array(
			'avatar'			=>		'http://tp3.sinaimg.cn/2421734942/50/5614855967/0',
			'created_at'			=>		$data['post_date'],
			'type'			=>		'food',
			'name'			=>		$data['post_title'],
			'author'			=>		'wuming',
			'id'			=>		$data['ID'],
			'text'			=>		$data['post_content']
		);
	}
	
	
	$output['statuses'] = $result_data;
	
	echo json_encode($output);
?>